﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;

namespace ProcessInterceptor
{
	public partial class AskForm : Form
	{
		public AskForm()
		{
			InitializeComponent();
		}

		private void textBox1_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Enter)
			{
				RegistryKey key;
				key = Registry.CurrentUser.OpenSubKey("Software\\Intercept", true);

				string _value = key.GetValue("password").ToString();

				if (_value == textBox1.Text)
					DialogResult = DialogResult.OK;
				else
					DialogResult = DialogResult.Cancel;
				Close();
			}
		}
	}
}
